package com.fr.data.impl;

import com.fr.base.XMLable;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;

public class TableColumn
  implements XMLable
{
  private String tableDataName;
  private int columnIndex;

  public TableColumn()
  {
  }

  public TableColumn(String paramString, int paramInt)
  {
    this.columnIndex = paramInt;
    this.tableDataName = paramString;
  }

  public String getTableDataName()
  {
    return this.tableDataName;
  }

  public void setTableDataName(String paramString)
  {
    this.tableDataName = paramString;
  }

  public int getColumnIndex()
  {
    return this.columnIndex;
  }

  public void setColumnIndex(int paramInt)
  {
    this.columnIndex = paramInt;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if ((paramXMLableReader.isChildNode()) && (paramXMLableReader.getTagName().equals("TableColumnAttr")))
    {
      String str;
      if ((str = paramXMLableReader.getAttr("table")) != null)
        setTableDataName(str);
      else if ((str = paramXMLableReader.getAttr("cloumnIndex")) != null)
        setColumnIndex(Integer.parseInt(str));
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("TableColumnAttr").attr("table", this.tableDataName).attr("columnIndex", this.columnIndex).end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }
}